package com.kly.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.kly.model.dto.PageQuery;
import com.kly.model.vo.PageResult;
import com.kly.model.domain.User;
import com.kly.model.vo.UserVo;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author admin
* @description 针对表【user(用户表)】的数据库操作Service
* @createDate 2025-02-15 18:58:12
*/
public interface UserService extends IService<User> {

    long userRegister(String account, String password, String checkPassword, String planetCode);

    /**
     * 用户登录
     */
    UserVo userLogin(String account, String password);


    /**
     * 用户脱敏
     */
    User getSafetyUser(User user);


    /**
     * 根据标签查询用户
     */
    List<User> searchUserByTags(List<String> tagNameList);


    /**
     * 获取登录用户
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 判断是否是管理员
     */
    Boolean isAdmin();



    Boolean isAdmin(User user);

    /**
     * 更新角色
     * @param user
     * @param loginUser
     * @return
     */
    Integer updateUser(User user, User loginUser);


    /**
     * 推荐用户
     *
     * @param pageQuery
     * @return
     */
    PageResult<User> recommendUsers(PageQuery pageQuery);
}
